﻿using ProtoBuf;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZyGames.Framework.Model;

namespace ZyGames.DZPocker.Model
{
	/// <summary>
	///	玩家保存牌桌记录表
	/// </summary>
	[Serializable, ProtoContract]
	[EntityTable(CacheType.Entity, DbConfig.Data, IsExpired = false)]
	public class SharedUserSaveTable : ShareEntity
	{
		public SharedUserSaveTable()
			: base(false)
		{
		}
		public SharedUserSaveTable(int userId, int tableId, int hand)
			: this()
		{
			this.UserID = userId;
			this.TableID = tableId;
			this.Hand = hand;
		}

		/// <summary>
		/// 玩家ID
		/// </summary>        
		[ProtoMember(1)]
		[EntityField("UserID", IsKey = true)]
		public int UserID { get; set; }

		/// <summary>
		/// GameTableData中的TableId
		/// </summary>        
		[ProtoMember(2)]
		[EntityField("TableID", IsKey = true)]
		public int TableID { get; set; }

		[ProtoMember(3)]
		[EntityField("Hand", IsKey = true)]
		public int Hand { get; set; }
	}

	/// <summary>
	/// 保存的牌局记录
	/// </summary>
	[Serializable, ProtoContract]
	public class SavedHandTable
	{
		[ProtoMember(1)]
		public SharedUserSaveTable Table { get; set; }

		[ProtoMember(2)]
		public int SmallBind { get; set; }

		[ProtoMember(3)]
		public DateTime StartTime { get; set; }

		[ProtoMember(4)]
		public int Score { get; set; }
	}
}
